
//
// Created by 蓝布鲁 on 2017/3/28.
// Copyright (c) 2017 蓝布鲁. All rights reserved.
//

#import "UIViewController+Swizzling.h"
#import "Swizzling.h"

@implementation UIViewController (Swizzling)

+ (void)load {
    swizzling_exchangeMethod([self class], @selector(initWithNibName:bundle:), @selector(swizzling_initWithNibName:bundle:));
    
    swizzling_exchangeMethod([self class], @selector(viewWillDisappear:), @selector(swizzling_viewWillDisappear:));
}

- (instancetype)swizzling_initWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil {
    id instance = [self swizzling_initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (instance) {
        self.hidesBottomBarWhenPushed = true;

    }
    return instance;
}

-(void)swizzling_viewWillDisappear:(BOOL)animated{
    if ([SVProgressHUD isVisible]) {
        [SVProgressHUD dismiss];
    }
    [self swizzling_viewWillDisappear:animated];
}



@end
